using System;
using System.Collections.Generic;
using System.Text;
using CommonTypes;

namespace MVCFramework
{
    public class CompositeModifiable : List<IModifiable>, IModifiable, ISelectable
    {
        #region IModifiable Members

        public bool Move(Vector v)
        {
            foreach (IModifiable modifiable in this)
            {
                modifiable.Move(v);
            }
            return true;
        }


        #endregion

        #region ISelectable Members

        public bool IsSelected
        {
            get
            {
                return true;
            }
            set
            {
                foreach (IModifiable _object in this)
                {
                    if (_object is ISelectable)
                    {
                        ((ISelectable)_object).IsSelected = value;
                    }
                }
            }
        }

        #endregion

        #region ISelectable Members

        public int SelectionPriority
        {
            get
            {
                return 100;
            }
            set
            {
                throw new Exception("The method or operation is not implemented.");
            }
        }

        #endregion
    }

}
